$(document).ready(function(e) {
	$(".log").mouseover(function(){
		$(this).css("background-image", "url(images/log2.gif)");
	});
	$(".log").mouseout(function(){
		$(this).css("background-image", "url(images/log.gif)");
	});
	$(".reg").mouseover(function(){
		$(this).css("background-image", "url(images/reg2.gif)");
	});
	$(".reg").mouseout(function(){
		$(this).css("background-image", "url(images/reg.gif)");
	});
});
$(document).ready(function(e) {
	$(".shouye").css("background", "url(images/shouye2.gif)");
	var url = "../content/shouye.html";
	$.ajax({
		type:"GET",
		url:url,
		dataType:"html",
		beforeSend: function(){},
		success: function(data){
			$(".main").html(data);
		}
	});
    $(".shouye").click(function(){
		$(".shouye").css("background", "url(images/shouye2.gif)");
		$(".youhui").css("background", "url(images/youhui.gif)");
		$(".fuwu").css("background", "url(images/fuwu.gif)");
		$(".huodong").css("background", "url(images/huodong.gif)");
		$(".shetuan").css("background", "url(images/shetuan.gif)");
		$(".vip").css("background", "url(images/vip.gif)");
		$.ajax({
			type:"GET",
			url:"../content/shouye.html",
			dataType:"html",
			beforeSend: function(){},
			success: function(data){
				$(".main").html(data);
			}
		});
	});
    $(".youhui").click(function(){
		$(".shouye").css("background", "url(images/shouye.gif)");
		$(".youhui").css("background", "url(images/youhui2.gif)");
		$(".fuwu").css("background", "url(images/fuwu.gif)");
		$(".huodong").css("background", "url(images/huodong.gif)");
		$(".shetuan").css("background", "url(images/shetuan.gif)");
		$(".vip").css("background", "url(images/vip.gif)");
		$.ajax({
			type:"GET",
			url:"../content/youhui.html",
			dataType:"html",
			beforeSend: function(){},
			success: function(data){
				$(".main").html(data);
			}
		});
	});
    $(".fuwu").click(function(){
		$(".shouye").css("background", "url(images/shouye.gif)");
		$(".youhui").css("background", "url(images/youhui.gif)");
		$(".fuwu").css("background", "url(images/fuwu2.gif)");
		$(".huodong").css("background", "url(images/huodong.gif)");
		$(".shetuan").css("background", "url(images/shetuan.gif)");
		$(".vip").css("background", "url(images/vip.gif)");
		$.ajax({
			type:"GET",
			url:"../content/fuwu.html",
			dataType:"html",
			beforeSend: function(){},
			success: function(data){
				$(".main").html(data);
			}
		});
	});
    $(".huodong").click(function(){
		$(".shouye").css("background", "url(images/shouye.gif)");
		$(".youhui").css("background", "url(images/youhui.gif)");
		$(".fuwu").css("background", "url(images/fuwu.gif)");
		$(".huodong").css("background", "url(images/huodong2.gif)");
		$(".shetuan").css("background", "url(images/shetuan.gif)");
		$(".vip").css("background", "url(images/vip.gif)");
		$.ajax({
			type:"GET",
			url:"../content/huodong.html",
			dataType:"html",
			beforeSend: function(){},
			success: function(data){
				$(".main").html(data);
			}
		});
	});
    $(".shetuan").click(function(){
		$(".shouye").css("background", "url(images/shouye.gif)");
		$(".youhui").css("background", "url(images/youhui.gif)");
		$(".fuwu").css("background", "url(images/fuwu.gif)");
		$(".huodong").css("background", "url(images/huodong.gif)");
		$(".shetuan").css("background", "url(images/shetuan2.gif)");
		$(".vip").css("background", "url(images/vip.gif)");
		$.ajax({
			type:"GET",
			url:"../content/shetuan.html",
			dataType:"html",
			beforeSend: function(){},
			success: function(data){
				$(".main").html(data);
			}
		});
	});
    $(".vip").click(function(){
		$(".shouye").css("background", "url(images/shouye.gif)");
		$(".youhui").css("background", "url(images/youhui.gif)");
		$(".fuwu").css("background", "url(images/fuwu.gif)");
		$(".huodong").css("background", "url(images/huodong.gif)");
		$(".shetuan").css("background", "url(images/shetuan.gif)");
		$(".vip").css("background", "url(images/vip2.gif)");
		$.ajax({
			type:"GET",
			url:"../content/vip.html",
			dataType:"html",
			beforeSend: function(){},
			success: function(data){
				$(".main").html(data);
			}
		});
	});
});
$(document).ready(function(e) {
    $(".gotop").click(function(){
		window.scrollTo(0, 0);
	})
	$(".gotop").mouseover(function(){
		$(this).css("opacity", "0.6")	
	})
	$(".gotop").mouseout(function(){
		$(this).css("opacity", "0.3")	
	});
});
$(document).scroll(function(){
 	var top = $(window).scrollTop();
	if(top>=100)
		$(".gotop").fadeIn("fast");
	else
		$(".gotop").fadeOut("fast");
});
$(document).ready(function(e) {
	$(".search form input[name='keyword']").val('请输入商家名称');
    $(".search form input[name='keyword']").focus(function() {
		$(this).val('')
		.css("outline", "none");
	});
    $(".search form input[name='keyword']").focusout(function(e) {
		if($(this).val() == '')
			$(this).val('请输入商家名称');
    });
});
$(document).ready(function(e) {
	$(".log form input[name='cardnum']").val('校联购VIP卡号');
    $(".log form input[name='cardnum']").focus(function() {
		if($(this).val() == '校联购VIP卡号'){
			$(this).val('')
				.css("outline", "none");
		}
		else{
			$(this).css("outline", "none");
		}
	});
    $(".log form input[name='cardnum']").focusout(function(e) {
		if($(this).val() == '')
			$(this).val('校联购VIP卡号');
    });
});
$(document).ready(function(e) {
	$(".log form input[name='password']").val('00000000');
    $(".log form input[name='password']").focus(function() {
		$(this).val('')
		.css("outline", "none");
	});
    $(".log form input[name='password']").focusout(function(e) {
		if($(this).val() == '')
			$(this).val('00000000');
    });
});

